package org.example.sduty.mqtt.b;

import lombok.extern.slf4j.Slf4j;

/**
 * @program: rabbitmq-study
 * @description:
 * @Version V1.0.0
 * @author: dazhi
 * @create: 2022-01-07 16:34
 **/
@Slf4j
public class Test {
    public static void main(String[] args) throws Exception {
        WebsocketClient websocketClient1 = new WebsocketClient("ws://82.157.123.54:9010/ajaxchattest", 3);
        // 连接
        websocketClient1.connect();
        // 发送消息
        websocketClient1.write("xxxxxxxxxxxxxxxxx");
        // 获取结果
        String result1 = websocketClient1.receiveResult();
        log.info("接收到结果[{}]", result1);

        WebsocketClient websocketClient2 = new WebsocketClient("ws://192.168.8.107:8888/ws", 3);
        websocketClient2.connect();
        // 发送消息
        websocketClient2.write("aaa");
        // 获取结果
        String result2 = websocketClient2.receiveResult();
        log.info("接收到结果[{}]", result2);

    }

}
